﻿using BCEntity.TMS.MarketingCoupon.MarketingCouponStatistics;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace BCData.TMS.MarketingCoupon.MarketingCouponStatistics
{
    public interface IMarketingCouponStatisticsData
    {

        /// <summary>
        /// 获取统计
        /// </summary>
        /// <param name="agentRecordId"></param>
        /// <param name="isCommonBusiness"></param>
        /// <param name="vehicleTransportBusinessConfigId"></param>
        /// <returns></returns>
        Task<MarketingCouponStatisticsEntity> GetStatistics(long agentRecordId, bool isCommonBusiness, long? vehicleTransportBusinessConfigId);
        /// <summary>
        /// 获取领取数量
        /// </summary>
        /// <param name="marketingCouponTypeId"></param>
        /// <param name="startDate"></param>
        /// <param name="endDate"></param>
        /// <returns></returns>
        Task<int> GetReceiveCount(long marketingCouponTypeId, DateTime? startDate, DateTime? endDate);

        /// <summary>
        /// 获取使用数量
        /// </summary>
        /// <param name="marketingCouponTypeId"></param>
        /// <param name="startDate"></param>
        /// <param name="endDate"></param>
        /// <returns></returns>
        Task<int> GetUsingCount(long marketingCouponTypeId, DateTime? startDate, DateTime? endDate);
        /// <summary>
        /// 获取详情统计
        /// </summary>
        /// <param name="agentRecordId">代理商id</param>
        /// <param name="isCommonBusiness">是否通用</param>
        /// <param name="vehicleTransportBusinessConfigId">运输业务id</param>
        /// <param name="isExpired">是否过期</param>
        /// <returns></returns>
        Task<IEnumerable<MarketingCouponStatisticsDetailEntity>> GetDetailList(long agentRecordId, bool isCommonBusiness,
            long? vehicleTransportBusinessConfigId, bool? isExpired);
        /// <summary>
        /// 获取详情统计(分页)
        /// </summary>
        /// <param name="agentRecordId">代理商id</param>
        /// <param name="isCommonBusiness">是否通用</param>
        /// <param name="vehicleTransportBusinessConfigId">运输类型id</param>
        /// <param name="isExpired">是否过期</param>
        /// <returns></returns>
        Task<(IEnumerable<MarketingCouponStatisticsDetailEntity>, int)> GetDetailQuery(long agentRecordId, bool isCommonBusiness,
            long? vehicleTransportBusinessConfigId, bool? isExpired, int pageIndex, int pageSize);
        /// <summary>
        /// 获取优惠券统计(看板)
        /// </summary>
        /// <param name="agentRecordId">代理商id</param>
        /// <param name="isCommonBusiness">是否通用</param>
        /// <param name="vehicleTransportBusinessConfigId">运输业务id</param>
        /// <param name="startDate">开始日期</param>
        /// <param name="endDate">结束日期</param>
        /// <returns></returns>
        Task<MarketingCouponStatisticsEntity> GetMarketingCouponAgentStatistics(long agentRecordId, bool? isCommonBusiness, 
            long? vehicleTransportBusinessConfigId, DateTime? startDate, DateTime? endDate);

        /// <summary>
        /// 获取金额
        /// </summary>
        /// <param name="agentRecordId">代理商id</param>
        /// <param name="isCommonBusiness">是否通用</param>
        /// <param name="vehicleTransportBusinessConfigId">运输业务id</param>
        /// <param name="startDate">开始日期</param>
        /// <param name="endDate">结束日期</param>
        /// <returns></returns>
        Task<IEnumerable<MarketingCouponTransportBusinessAmountEntity>> GetMarketingCouponTransportBusinessAmount(
            long agentRecordId,
            bool? isCommonBusiness, long? vehicleTransportBusinessConfigId, DateTime? startDate, DateTime? endDate);
    }
}